<script setup lang="ts">
import { Tips as AppNutIconTips } from '@nutui/icons-vue-taro';
import { ASSET_STATUS, ASSET_STATUS_COLOR } from '/@/common/constant';
import { getSysImgUrl } from '/@/utils/index';
interface Props {
  info: AssetInfo.Dto;
}

const props = withDefaults(defineProps<Props>(), {
  info: () => {
    return {};
  },
});
</script>

<template>
  <view class="app-archives-item">
    <view class="app-archives-item--left">
      <nut-avatar size="large" shape="square">
        <image v-if="props.info.picUrl" :src="getSysImgUrl(props.info.picUrl)" />
        <app-nut-icon-tips v-else />
      </nut-avatar>
    </view>
    <view class="app-archives-item--right">
      <view class="app-archives-item__name">{{ props.info.assetName || '-' }}</view>
      <view class="app-archives-item__organization-name">
        <text>所属部门:&nbsp;&nbsp;</text>
        <text>{{ props.info.organizationName || '-' }}</text>
      </view>
      <view class="app-archives-item__organization-name">
        <text>档案状态:&nbsp;&nbsp;</text>
        <text
          :style="{ color: props.info.status ? ASSET_STATUS_COLOR[props.info.status] : '#333' }"
        >
          {{ props.info.status ? ASSET_STATUS[props.info.status] : '-' }}
        </text>
      </view>
    </view>
  </view>
</template>

<style lang="scss">
@import './index.scss';
</style>
